package com.scujcc.diandiantv;

import java.util.ArrayList;
import java.util.List;

public class ChannelLab {
    private static ChannelLab INSTANCE = null;
    private List<Channel> data = new ArrayList<>();
    private ChannelLab() {
        //FIXME
        for (int i = 0; i< 20; i++) {
            Channel c = new Channel();
            c.setName("中央" + (i+1) + "台");
//            c.setResolution("720dp");
            data.add(c);
        }
    }
    public static ChannelLab get() {
        if (INSTANCE == null) {
            INSTANCE = new ChannelLab();
        }
        return INSTANCE;
    }
    /**
     * 返回频道总数
     * @return
     */
    public int getChannelCount() {
        return this.data.size();
    }
    /**
     * 返回第N个频道对象。
     * @param n
     */
    public Channel getChannel(int n) {
        return this.data.get(n);
    }
}
